home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1998 September / EnigmA AMIGA RUN 30 (1998)(G.R. Edizioni)(IT)[!][issue 1998-09].iso / recent / yam2usnt.lha / usenet.install.rexx < prev    next >
OS/2 REXX Batch file  |  1998-07-16  |  7KB  |  136 lines

  1. /* -----------------------------------------------------
  2.       YAM2Usenet v0.5 installation file : 16-Jul-98
  3.    ©1998 Ridwan Hughes <yam2usenet@ridhughz.demon.co.uk>
  4.        http://www.ridhughz.demon.co.uk/yam2usenet/
  5.    ----------------------------------------------------- */
  6.  
  7. if ~exists('libs:rexxreqtools.library') then do
  8.  if exists('libs/rexxreqtools.library') then address command 'copy libs/rexxreqtools.library libs:'
  9.  else do
  10.   address command 'run <>nil: c:requestchoice "YAM2Usenet v0.5 ©  1998 Ridwan Hughes" "ERROR: cannot find rexxreqtools.library*NPlease make sure it exists in libs:*Nif it didn''t come with this archive*Nthen download it from Aminet:*NRexxReqTools.lha  util/rexx  65K  1.3 - requester for ARexx" OK'
  11.   exit 0
  12.   end
  13.  end
  14. if ~show('L','rexxreqtools.library') then addlib('rexxreqtools.library',0,-30,0)
  15.  
  16. datestamp=date('s')||compress(time(),':')
  17.  
  18. /* start of checking that TCP: exists */
  19. /*                                    */
  20. address command 'assign >t:assignlist';o=open(as,'t:assignlist')
  21. tcp=0;rl=readln(as);do while rl~='Devices:';rl=readln(as);end
  22. do while ~eof(as)
  23.  if words(rl)>0 then do;do i=1 to words(rl);if word(rl,i)='TCP' then tcp=1;end;end
  24.  rl=readln(as)
  25.  end
  26. close(as)
  27. if tcp=0 then quitmsg('ERROR:*NPlease start your TCP/IP stack.')
  28. /*                                  */
  29. /* end of checking that TCP: exists */
  30.  
  31. address command 'requestchoice "YAM2Usenet v0.5 ©1998 Ridwan Hughes" "This is a script I wrote to connect to a newsserver and download*Nusenet articles then parse them into YAM2 to be read.*N*NThe usage of these scripts assumes you know how to use YAM2*Ncompetently enough to create folders+filters for the*Nnewsgroup(s) you download from.*N*NIf you want to continue then click on OK*N*NYAM2Usenet v0.5 ©1998 Ridwan Hughes <yam2usenet@ridhughz.demon.co.uk>" "OK, install it" "Update scripts to v0.5" "Quit installation" >pipe:out'
  32.  
  33. o=open(inn,'pipe:out','r');rl=readln(inn);close(inn);if rl=0 then exit 0
  34.  
  35. address command 'copy <>nil: usenet.post.rexx YAM:'
  36. address command 'copy <>nil: usenet.read.rexx YAM:'
  37. address command 'copy <>nil: usenet.doc YAM:'
  38.  
  39. if rl=2 then do;address command 'requestchoice "YAM2Usenet v0.5 ©1998 Ridwan Hughes"
  40. "YAM2Usenet ©1998 Ridwan Hughes is now updated to v0.5*N<yam2usenet@ridhughz.demon.co.uk>" OK >nil:';exit 0;end
  41.  
  42. address command 'copy <>nil: usenet.post.rexx.info YAM:'
  43. address command 'copy <>nil: usenet.read.rexx.info YAM:'
  44. address command 'copy <>nil: usenet.doc.info YAM:'
  45.  
  46. nserver=rtgetstring('','Enter news server name (blank to quit installation)'d2c(10)'usually it''s  news.your.isp  like  news.demon.co.uk,'d2c(10)'but not all newsservers are public ones.'d2c(10)||d2c(10)'Some public access newsservers are as follows: server (groups carried):'d2c(10)'209.75.104.10 (25000), 195.204.199.88 (22600), 206.28.168.22 (28000)'d2c(10)'news.edu.sollentuna.se (23000), news-reader.wcg.net (60000),'d2c(10)'news.okidata.com (24000), pub.news.uk.psi.net (18500), news.uov.net (21000)'d2c(10)'news.spar.ca (18500), 209.125.132.138 (29000), 209.60.156.214 (23500)'d2c(10)'194.78.80.195 (34000), news.ausmail.com (??), sion1.bathspa.ac.uk (28000)','YAM2Usenet v0.5 ©1998 Ridwan Hughes','OK')
  47. if nserver='' | rtresult=0 then exit 0
  48. address command 'echo >yam:usenet.server "'nserver'"'
  49.  
  50. ngroup=rtgetstring('','Enter the first newsgroup to join (blank to quit installation)','YAM2Usenet v0.5 ©1998 Ridwan Hughes','OK')
  51. if ngroup='' | rtresult=0 then exit 0
  52.  
  53. ngdisp=ngroup
  54. ng=ngroup
  55.  
  56. address command 'requestchoice "YAM2Usenet v0.5 ©1998 Ridwan Hughes" "Join more newsgroups?  current newsgroups are:*N*N'ngdisp'" "Add more newsgroups" "Finished adding newsgroups" >pipe:out'
  57. o=open(inn,'pipe:out','r');stoppit=1-readln(inn);close(inn)
  58. do while stoppit=0
  59.  n=rtgetstring('','Enter in another newsgroup to join:','YAM2Usenet v0.5 ©1998 Ridwan Hughes','OK')
  60.  if n='' then stoppit=1
  61.  else do
  62.   ng=ng||d2c(10)||n
  63.   ngdisp=ngdisp||'*N'||n
  64.   address command 'requestchoice "YAM2Usenet v0.5 ©1998 Ridwan Hughes" "Join more newsgroups?  current newsgroups are:*N*N'ngdisp'" "Add more newsgroups" "Finished adding newsgroups" >pipe:out'
  65.   o=open(inn,'pipe:out','r');stoppit=1-readln(inn);close(inn)
  66.   end
  67.  end
  68.  
  69. if open(f,'yam:usenet.groups','w') then do;writeln(f,ng);close(f);end
  70.  else quitmsg('ERROR:*NThe file [usenet.groups] cannot be accessed for some reason,*Nanother program probably has it open.')
  71.  
  72. /* datestamp datestamp datestamp datestamp datestamp datestamp datestamp */
  73.  
  74. ds='-'||left(datestamp,4)
  75. ds='-'right(left(datestamp,6),2)||ds
  76. ds=right(left(datestamp,8),2)||ds' '
  77.  
  78. ds=ds||right(left(datestamp,10),2)
  79. ds=ds||':'||right(left(datestamp,12),2)
  80. ds=ds||':'||right(datestamp,2)
  81.  
  82. address command 'requestchoice "YAM2Usenet v0.5 ©1998 Ridwan Hughes" "The current datestamp 'ds' will be set,*Nunless you either use the datestamp from the newsserver,*Nor you enter in your own datestamp to get backlogged articles?*N(you must be online to take the newsserver datestamp)" "Current date" "Newsserver date" "Set own date" >pipe:out'
  83.  
  84. o=open(inn,'pipe:out','r');rl=readln(inn);close(inn)
  85. if rl=0 then do
  86.  nd=rtgetstring(datestamp,'Enter in new datestamp, current is '||ds||d2c(10)'which you must enter it in like: 'datestamp||d2c(10)'YYYYMMDDHHMMSS - year month day hour(24hour) minute second','YAM2Usenet v0.5 ©1998 Ridwan Hughes','OK')
  87.  if nd='' | rtresult=0 then nd=datestamp
  88.  datestamp=nd
  89.  end
  90. if rl=2 then do
  91.  if open(newz,'tcp:'nserver'/119','a') then do
  92.   null=readln(newz)
  93.   writeln(newz,'DATE')
  94.   datestamp=left(word(readln(newz),2),14)
  95.   close(newz)
  96.   end
  97.  end
  98. address command 'echo >yam:usenet.datestamp "'datestamp'"'
  99.  
  100.  
  101. address command 'requestchoice "YAM2Usenet v0.5 ©1998 Ridwan Hughes" "Do you want to add any entries into the killfile?" Yes No >pipe:out'
  102.  
  103. o=open(inn,'pipe:out','r');rl=readln(inn);close(inn)
  104. kill=''
  105. if rl=1 then do
  106.  killdisp=''
  107.  stoppit=0
  108.  do while stoppit=0
  109.   k=rtgetstring('','Enter in a new killfile line, articles are killfiled'||d2c(10)'by their Message-ID: lines, for example if you'd2c(10)'have the ID  <qRdezgAqqUl1EaAl@some.spam.net>  then you'd2c(10)'enter in  @some.spam.net>  to kill posts from there.','YAM2Usenet v0.5 ©1998 Ridwan Hughes','OK')
  110.   if k='' then stoppit=1
  111.   else do
  112.    kill=kill||k||d2c(10)
  113.    killdisp=killdisp||k||'*N'
  114.    address command 'requestchoice "YAM2Usenet v0.5 ©1998 Ridwan Hughes" "Stop adding entries into the killfile?  current entries are:*N*N'left(killdisp,length(killdisp)-2)'" "Add more kill lines" "Stop adding" >pipe:out'
  115.    o=open(inn,'pipe:out','r');stoppit=1-readln(inn);close(inn)
  116.    end
  117.   end
  118.  end
  119.  
  120. if length(kill)>0 then kill=left(kill,length(kill)-1)
  121. if open(f,'yam:usenet.killfile','w') then do;writeln(f,kill);close(f);end
  122.  else quitmsg('ERROR:*NThe file [usenet.killfile] cannot be accessed for some reason,*Nanother program probably has it open.')
  123.  
  124. quitmsg('YAM2Usenet v0.5 ©1998 Ridwan Hughes <yam2usenet@ridhughz.demon.co.uk>*Nis now installed into your YAM: drawer.*NAll you need to do now is to read the usenet.doc file, run YAM2,*Nset up the appropriate filters+folders and then click on the*Nusenet.read.rexx icon in your YAM2 drawer to
  125.  download news*Narticles from your favourite newsgroup(s).*N*NEnjoy...')
  126.  
  127. exit 0
  128.  
  129. /* ************************************* */
  130.  
  131. quitmsg: procedure
  132.  parse arg why
  133.  address command 'run <>nil: c:requestchoice "YAM2Usenet v0.5 ©1998 Ridwan Hughes" "'why'" OK'
  134.  exit 0
  135.  return
  136.